package org.summer.lawyer.constant.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 *
 */
@Getter
@AllArgsConstructor
public enum WithdrawStatus {

    /**
     * 10发起申请（待审核理）
     */
    PENDING("10", "待审核"),

    /**
     * 19提现中
     */
    PROCESS("19","提现中"),

    /**
     * 20提现成功
     */
    SUCCESS("20", "提现成功"),

    /**
     * 30审核不通过
     */
    REJECTION("30", "审核不通过"),

    /**
     * 40提现失败
     */
    FAILURE("40", "提现失败");

    public static WithdrawStatus getByCode(String code) {
        return ArrayUtil.firstMatch(item -> Objects.equals(item.getCode(), code), values());
    }

    private final  String code;

    private final String info;
}
